function relo(id, status) {
    layui.use(['table','layer'], function () {
        var table = layui.table;
        var layer = layui.layer;

        table.render({
            elem: '#test'
            , id: 'testReload'
            , url: 'jay/OutBound/getOutBoundDetail'
            , parseData: function (res) {
                return {
                    "code": 0, //解析接口状态
                    "msg": "", //解析提示文本
                    "count": res.obj.total, //解析数据长度
                    "data": res.obj.list //解析数据列表
                };
            }
            , toolbar: '#toolbarDemo'
            , title: '出库明细表'
            , where: { id: id }
            , cols: [[
                { fix: 'left', field: 'id', title: '序号', align: 'center', width: 80, sort: true }
                , { field: 'goodsName', title: '商品名称', align: 'center', width: 200 }
                , { field: 'specificationName', title: '商品规格', align: 'center', width: 100 }
                , { field: 'outBoundQuantity', title: '出库数量', align: 'center', width: 100, sort: true }
                , { field: 'haveBeenOutboundQuantity', title: '已出库数量', align: 'center', width: 140, sort: true }
                , {
                    field: 'stauts', title: '出库状态', align: 'center', width: 140, templet: function (obj) {
                        if (obj.stauts == 1) {//出库状态表示5则为完成
                            return "已完成";
                        } else if (obj.stauts == 2) {
                            return "未完成";
                        } else {
                            return "新录入";
                        }
                    }
                }
                , { fixed: 'right', title: '操作', align: 'center', toolbar: '#barDemo' }
            ]]
            , page: true
            , even: true
            , limit: 3
            , limits: ['5', '7', '10']
        });
        //工具栏事件
        var $ = layui.$, active = {
            reload: function () {
                table.reload('testReload', {
                    page: {
                        curr: 1//默认从第一页开始加载
                    },
                    where: {
                        goodsName: $('#goodsName').val()
                    }
                });
            }
        }
        $('#find').on('click', function () {
            var type = 'reload';
            active[type] ? active[type].call(this) : '';
        });
        table.on('tool(test)', function (obj) {
            var data = obj.data;
            if (obj.event == 'addPick') {
                if (status == 1 || status == 2) {
                    layer.msg("该出库单未通过审核,无法生成拣货明细", { icon: 2 })
                } else if (status == 5) {
                    layer.msg("该出库单已完成拣货任务，请勿重复点击", { icon: 2 })
                } else {
                    console.log(data.stauts);
                    if (data.stauts == 1) {
                        layer.msg("该明细项已完成，请勿重复点击", { icon: 1 })
                    } else if (data.stauts == 0) {
                        layer.open({
                            type: 2,
                            area: ['600px', '380px'],
                            title: '拣货详情',
                            content: 'pickDetail.html',
                            maxmin: true,
                            success: function (layero, index) {
                                var iframe = window['layui-layer-iframe' + index];
                                //调用子页面的全局函数
                                var totalNum = data.outBoundQuantity - data.haveBeenOutboundQuantity;//还需要出库的商品数量
                                iframe.pickDetail(data.goodsId, totalNum, data.outBoundId,
                                    data.goodsName, data.specificationName);
                            }
                        })
                    } else {
                        layer.msg("该明细项已生成过拣货明细，请勿重复点击", { icon: 2 })
                    }
                }
            } else {
                layer.msg("添加任务失败，请检查出库单状态", { icon: 2 });
            }
        });
    });
}